/*
 * The contents of this file are subject to the GNU GPL v3 (the "License"); 
 * you may not use this file except in compliance with the License. You may 
 * obtain a copy of the License at URL http://www.gnu.org/licenses/gpl.html
 *
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * 
 *
 * The Original Code is EATEP (eater).
 *
 * The development of the EATEP was supported by Veterans Affairs Health 
 * Services Research and Development Award (HIR-08-204). The Initial 
 * Developer of the Original Code is VA Informatics and Computing 
 * Infrastructure (VINCI) and University of Utah.  
 * Copyright (C) 2009 - 2013.  All Rights Reserved.
 *
 * Current information about eHOST can be located at 
 * http://http://code.google.com/p/ehost/
 * 
 * Categories:
 * Scientific/Engineering
 * 
 * Intended Audience:
 * Science/Research
 * 
 * User Interface:
 * Java Swing, Java AWT, Custom Components.
 * 
 * Programming Language
 * Java 1.6
 *
 * Contributor(s):
 *   Jianwei "Chris" Leng <Chris.Leng@utah.edu> (Original Author), 2009-2013
 *   
 *   
 */

package gui;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
import javax.swing.border.EmptyBorder;

public class GTMainWindow extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7157348060301750824L;
	private JPanel contentPane;
	private JPanel infor_bar;

	/**
	 * Launch the application.
	 
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					GTMainWindow frame = new GTMainWindow();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}*/

	/**
	 * Create the frame.
	 */
	public GTMainWindow() {
		
		// basic setting to the frame
		setTitle("EATEP: The Extendable and Accumulable Text Extraction Platform : alpha 0.01.30");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);					
		setBounds(100, 100, 450, 300);
		setBackground( new Color(232,232,232));
		contentPane = new JPanel();
		contentPane.setBackground( new Color(232,232,232));
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
		
		// add bottom bar on the bottom of this main window
		infor_bar = gui.bottombar.BottomBarController.getComponent();
		contentPane.add(infor_bar, BorderLayout.SOUTH);
		
		JSplitPane splitPane = new JSplitPane();
		splitPane.setBackground( new Color(232,232,232) );
		splitPane.setDividerLocation( 300 );
		splitPane.setResizeWeight( 0.2 );
		splitPane.setBorder( null );
		contentPane.add(splitPane, BorderLayout.CENTER);		
		
		// add the left split pane for 
		JSplitPane splitPane_left = new JSplitPane();
		splitPane_left.setOrientation(JSplitPane.VERTICAL_SPLIT);
		splitPane_left.setDividerLocation( 500 );
		splitPane_left.setResizeWeight(0.7);
		splitPane_left.setBorder( null );
		splitPane.setLeftComponent(splitPane_left);
		
		JPanel panel_navigator = gui.navigation.NavigatorController.getComponent();
		splitPane_left.setLeftComponent(panel_navigator);
		splitPane_left.setBackground( new Color(232,232,232) );
		
		
		JPanel panel_2 = new JPanel();
		splitPane_left.setRightComponent(panel_2);
		
		JSplitPane splitPane_right = new JSplitPane();
		splitPane_right.setOrientation(JSplitPane.VERTICAL_SPLIT);
		splitPane_right.setBorder( null );
		splitPane_right.setBackground( new Color(232,232,232));
		splitPane_right.setDividerLocation( 515 );
		splitPane_right.setResizeWeight( 1.0 );
		splitPane.setRightComponent(splitPane_right);
		
		JPanel panel_1 = new JPanel();
		splitPane_right.setLeftComponent(panel_1);
		
		JPanel panel_log = gui.guilog.GUILogController.getComponent();
		splitPane_right.setRightComponent(panel_log);
		
		// set window size
		Dimension windowsize = new Dimension(1024,768); 
		this.setSize( windowsize );
		this.setPreferredSize( windowsize );
		
		// resizeable
		this.setResizable( true );
		
		// set screen location
		//this.setLocation(10, 10);
		setLocationRelativeTo( null );
	}

}
